#include <stdio.h>
#include "BST.h"
#include <stdlib.h>
int main()
{
    //struct BitNode*root = Create_input_BitSortTree();
    struct BitNode*p[4];
    for(int i = 0; i < 4; i++)
    {
        p[i] = malloc(sizeof(*p[i]));
        p[i]->lchild = p[i]->rchild = NULL;
        p[i]->data = i+6;
    }// p[0] => 6 p[1] ==> 7  p[2] ==> 8 p[3] ==> 9
    //printf("%d\n",__LINE__);
    //p[3]->data = 6;
    struct BitNode*root = p[2];
    p[2]->lchild = p[1];
    //p[1]->lchild = p[0];
    p[1]->rchild = p[3];
    //p[2]->rchild = p[3];
    //printf("%d\n",__LINE__);

   
    printf("Pre:");
    Pre_order(root);
    printf("\n");
    printf("Mid:");
    Mid_order(root);
    printf("\n");
    printf("Post:");
    Post_order(root);
    printf("\n");
    Level_Travel(root);
    printf("%d\n", Get_H(root));

    printf("%d\n", Is_sortBitTree(p[0]));
    printf("%d\n", Is_sortBitTree(p[1]));
    printf("%d\n", Is_sortBitTree(p[2]));
    printf("%d\n", Is_sortBitTree(p[3]));
    printf("=============\n");
    TElemType d;
    printf("%d\n", Is_sortBitTree_1(p[0],1,&d));
    printf("%d\n", Is_sortBitTree_1(p[1],1,&d));
    printf("%d\n", Is_sortBitTree_1(p[2],1,&d));
    printf("%d\n", Is_sortBitTree_1(p[3],1,&d));
    // TElemType d;
    // scanf("%d", &d);
    // root = Delete_Node(root,d);
    // printf("Pre:");
    // Pre_order(root);
    // printf("\n");
    // printf("Mid:");
    // Mid_order(root);
    // printf("\n");
    // printf("Post:");
    // Post_order(root);
    // printf("\n");
}